const router = require('koa-router')()
router.prefix('/classType')

const msgModule = require('../../common/msg');
const Result = require('../../common/Result');


const classTypeService = require('../../services/class/type');

router.get('/listAll', async function (ctx, next) {
  try {
    const classTypeData = await classTypeService.listAll();
    ctx.body = Result.success(classTypeData, msgModule.querySuccess);
  } catch (error) {
    ctx.body = Result.error(error, msgModule.queryError);
  }
});

module.exports = router